/********************************** (C) COPYRIGHT *******************************
 * File Name          : IIC.H
 * Author             : RZ
 * Version            : V1.00
 * Date               : 2017-5-15
 * Description        : I2C 读写
 *******************************************************************************/

#ifndef __IIC_H__
#define __IIC_H__


#define CMD_S_PKT 0x52
#define CMD_R_PKT 0x53
#define CMD_W_PKT 0x54
#define RESET_PKT 0x77
#define CALIB_PKT 0x66

#ifdef __cplusplus
extern "C"
{
#endif

#include "CH554.h"
extern void I2CInit(void);
extern void I2CStart(void);
extern void I2CStop(void);
extern void I2CAck(void);
extern void I2CNack(void);
extern uint8_t I2CWaitAck(void);
extern void I2CSendByte(uint8_t txd);
extern uint8_t I2CReadByte(uint8_t ack);
extern int8_t I2CMasterRecv(uint8_t *AOutBuf, uint8_t ASize);

#ifdef __cplusplus
}
#endif

#endif

/* END OF FILE */
